<%@ Page Title="" Language="C#" MasterPageFile="~/RentAWorkerMaster.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<RentAWorker.DataAccess.Entities.RentalService>>" %>

<script runat="server">
    
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Session["Theme"] != null)
            this.Theme = Session["Theme"].ToString();
    }
    
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<title>List</title>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="RightPlaceholder" runat="server">

    <h2>List</h2>
    
    <% for (int i = 7; i < 8 * 7; i=i+7)
       { %>
    <%=Html.ActionLink(
        string.Format("{1}{0} days{1}", i, 
            (int)ViewData["days"] == i ? "*" : string.Empty),"List", new  {days=i})%>
    <% } %>
    
    <table cellspacing="15">
        <tr>
            <th></th>
            <th>
                StartDate
            </th>
            <th>
                EndDate
            </th>
            <th>
                Resource
            </th>
            <th>
                Status
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id=item.RentalServiceID }) %> |
            </td>
            <td>
                <%= Html.Encode(item.StartDate.ToShortDateString()) %>
            </td>
            <td>
                <%= Html.Encode(item.EndDate.ToShortDateString())%>
            </td>
            <td>
                <%= Html.Encode(item.Resource.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.RentalServiceState.RentalServiceStateName) %>
            </td>
        </tr>
    
    <% } %>

    </table>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LeftPlaceholder" runat="server">
</asp:Content>

